﻿@model PageIM

@using (Ajax.BeginForm("Create", "Page",
        new AjaxOptions()
        {
            HttpMethod = "POST",
            OnBegin = "onBegin",
            OnComplete = "onComplete",
            OnSuccess = "updateSuccess",
            //OnFailure = "handleError",
            //  UpdateTargetId = "RoleList"

        }, new { @class = "form-horizontal", role = "form" }))
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)
    @Html.HiddenFor(model => model.Id)
    <!-- 添加菜单 Modal -->
    <div class="modal fade" id="ModalEdit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">创建页面</h4>
                </div>
                <div class="modal-body">
                                     
                            <!-- Nav tabs -->
                            <ul class="nav nav-tabs" role="tablist" style="margin-bottom:20px;">
                                <li role="presentation" class="active"><a href="#product" aria-controls="product" role="tab" data-toggle="tab">@EntityNames.Page</a></li>
                                <li role="presentation"><a href="#seo" aria-controls="seo" role="tab" data-toggle="tab">SEO设置</a></li>
                            </ul>
                                      
                            <!-- Tab panes -->
                            <div class="tab-content">
                                <div role="tabpanel" class="tab-pane active" id="product">

                               
                                    @Html.ValidationSummary(true, "", new { @class = "text-danger" })
                                    <div class="form-group">
                                        @Html.LabelFor(model => model.Title, htmlAttributes: new { @class = "control-label col-md-2" })
                                        <div class="col-md-10">
                                            @Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control" } })
                                            @Html.ValidationMessageFor(model => model.Title)
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        @Html.LabelFor(model => model.SeoName, htmlAttributes: new { @class = "control-label col-md-2" })
                                        <div class="col-md-10">
                                            @Html.EditorFor(model => model.SeoName, new { htmlAttributes = new { @class = "form-control" } })
                                            @Html.ValidationMessageFor(model => model.SeoName)
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        @Html.LabelFor(model => model.Body, htmlAttributes: new { @class = "control-label col-md-2" })
                                        <div class="col-md-10">
                                            @Html.TextAreaFor(model => model.Body, new { htmlAttributes = new { @class = "form-control" } })
                                            @Html.ValidationMessageFor(model => model.Body)
                                        </div>
                                    </div>




                                    <div class="form-group">
                                        @Html.LabelFor(model => model.Active, htmlAttributes: new { @class = "control-label col-md-2" })
                                        <div class="col-md-10">
                                            <div class="checkbox">
                                                <label>
                                                    @Html.EditorFor(model => model.Active)
                                                    @Html.ValidationMessageFor(model => model.Active)
                                                </label>
                                            </div>
                                        </div>
                                    </div>

                                </div>

                                <div role="tabpanel" class="tab-pane" id="seo">
                                    <div class="form-group">
                                        @Html.LabelFor(model => model.Keywords, new { @class = "col-md-2 control-label" })
                                        <div class="col-md-10">
                                            @Html.TextBoxFor(model => model.Keywords, new { @class = "form-control", placeholder = "关键字(SEO)" })
                                            <span class="help-block">如有多个关键字，请用英文逗号隔开</span>                                        
                                            @Html.ValidationMessageFor(model => model.Keywords)
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        @Html.LabelFor(model => model.SEODescription, new { @class = "col-md-2 control-label" })
                                        <div class="col-md-10">
                                            @Html.TextAreaFor(model => model.SEODescription, new { @class = "form-control", placeholder = "描述(SEO)" })
                                       
                                            @Html.ValidationMessageFor(model => model.SEODescription)
                                        </div>
                                    </div>

                                </div>

                            </div>      
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button class="btn btn-primary" type="submit" id="btnSave"><i class="fa fa-save fa-fw"></i>保存</button>
                </div>
            </div>
        </div>
    </div>
}

<script type="text/javascript" language=javascript>
    $.validator.unobtrusive.parse(document);
</script>